
  {{extend './layout.html'}}
  {{block 'content'}}
    <div class="home-main">
      <div class="home-main-list">
        <main class="site-main">
          {{each list}}
          <article class="article-list boxShadow">
            <div>
              <h2>
                <a href="/detail/{{$value._id}}" target="_blank">{{$value.title}}</a>
              </h2>
              <a href="/detail/{{$value._id}}" class="docs" target="_blank">
                <p class="text-two">{{$value.abstract}}</p>
              </a>
              <div class="meta">
                <span class="time">{{$value.createTime}}</span>
                <span class="num">{{$value.watch}}</span>
              </div>
            </div>
          </article>
          {{/each}}
          
          <div class="page">
            {{if page > 1}}
              <a href="/list?page={{page-1}}">上一页</a>
            {{else}}
              <a href="javascrpit:;">上一页</a>
            {{/if}}
            <% for(let i=1;i <= total; i++) {%>
              {{if(page == i) }}
                <a class="active" href="/list?page=<%= i %>"><%= i %></a>
              {{else}}
                <a href="/list?page=<%= i %>"><%= i %></a>
              {{/if}}
            <% } %>
            {{if page == total}}
              <a href="javascrpit:;">下一页</a>
            {{else}}
              <a href="/list?page={{page+1}}">下一页</a>
            {{/if}}
            <a href="javascrpit:;">第 {{page}} 页</a>
            <a href="javascrpit:;">共 {{total}} 页</a>
          </div>
        </main>
        <aside class="home-main-list-right">
          {{include './common/new.html' data}}
          {{include './common/hot.html' data}}
          {{include './common/label.html' data}}
        </aside>
      </div>
    </div>
  {{/block}} 
